package com.qi.spzx.manager.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.qi.spzx.model.dto.system.AssginRoleDto;
import com.qi.spzx.model.dto.system.LoginDto;
import com.qi.spzx.model.dto.system.SysRoleDto;
import com.qi.spzx.model.dto.system.SysUserDto;
import com.qi.spzx.model.entity.system.SysRole;
import com.qi.spzx.model.entity.system.SysUser;
import com.qi.spzx.model.vo.system.LoginVo;
import org.springframework.stereotype.Service;

public interface SysUserService extends IService<SysUser> {

    /**
     * 用户进行登录
     * @return
     */
    abstract LoginVo login(LoginDto loginDto) ;

    /**
     * 根据token查询用户信息
     * @param token
     * @return
     */
    SysUser getUserInfo(String token);

    /**
     * 退出登录
     * @param token
     */
    void logout(String token);


    /**
     * 进行分页查询
     * @param sysUserDto
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<SysUser> findByPage(SysUserDto sysUserDto, Integer pageNum, Integer pageSize);

    /**
     * 用户进行保存
     * @param sysUser
     */
    void saveSysUser(SysUser sysUser);

    /**
     * 进行用户的修改
     * @param sysUser
     */
    void updateSysUser(SysUser sysUser);

    /**
     * 进行用户的删除
     * @param userId
     */
    void deleteById(Long userId);

    /**
     * 进行用户角色的添加或修改
     * @param assginRoleDto
     */
    void doAssign(AssginRoleDto assginRoleDto);
}